/*
 * @Author: szx
 * @Date: 2022-02-13 13:11:46
 * @LastEditTime: 2022-02-13 13:21:09
 * @Description:
 * @FilePath: \leetcode\1400-1499\1414\1414.js
 */
/**
 * @param {number} k
 * @return {number}
 */
var findMinFibonacciNumbers = function (k) {
    let res = 0;
    while (k >= 1) {
        k -= fibo(k);
        res++;
    }
    return res;
};
const fibo = (num) => {
    let i1 = 1;
    let i2 = 1;
    let tmp = 1;
    while (true) {
        if (i1 > num) {
            return i2;
        } else {
            tmp = i1;
            i1 = i1 + i2;
            i2 = tmp;
        }
    }
};
console.log(findMinFibonacciNumbers(13));
